package com.qfmy.app.controller.novel;

import com.qfmy.app.service.novel.AuthorService;
import com.qfmy.app.vo.novel.AuthorVo;
import com.qfmy.common.result.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.qfmy.app.controller.novel
 * @date 2025/4/16
 * @description 作者
 */
@RestController
@RequestMapping("/app/author")
@SuppressWarnings("all")
public class AuthorController {
    /**
     * 注入service层
     */
    @Resource
    private AuthorService authorService;

    /**
     * 根据作者的名称获取作者信息
     */
    @RequestMapping("/getAuthorByName")
    public Result<AuthorVo> getAuthorByName(String authorName){
        AuthorVo authorVo = authorService.getAuthorByName(authorName);
        return Result.ok(authorVo);
    }
}
